﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="SQLSelect.aspx.cs" Inherits="Cn.Cellula.Website.Admin.Db.Dm.SQLSelect" Title="执行SQL查询操作" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_PageTitle" runat="server">
执行SQL查询操作
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_MainBody" runat="server">
    <fieldset>
        <legend>SQL</legend>
        <table border="0" cellpadding="0" cellspacing="0" class="query_table">
            <tr>
                <td class="query_title">
                    数据库名：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_DbName" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                </td>
                <td class="query_title">
                    服务器：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_Server" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td class="query_title">
                    端口：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_Port" runat="server" Width="40px"  MaxLength="50"></asp:TextBox>
                </td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
             </tr>
             <tr>
                <td class="query_title">
                    用户名：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_User" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td class="query_title">
                    密码：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_Pwd" TextMode="Password" runat="server" MaxLength="50"></asp:TextBox>
                </td>
                <td class="query_title">
                    字符集：
                </td>
                <td class="query_content">
                    <asp:TextBox ID="txt_Encode" runat="server" Width="40px" MaxLength="50"></asp:TextBox>
                </td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
            </tr>
            <tr>
                <td class="query_title" valign="top">SQL语句：</td>
                <td class="query_content" colspan="8">
                    <asp:TextBox runat="server" ID="txt_Sql" TextMode="MultiLine" Width="850px" Height="60px"></asp:TextBox>
                </td>
            </tr>
         </table>
    </fieldset>
    <div class="action_bar" style="text-align:center;">
        <asp:Button ID="btn_Query" runat="server" Text="执行SQL语句" onclick="btn_Query_Click" />
    </div>
    <fieldset>
        <legend>查询结果</legend>
        <asp:Label runat="server" ID="lab_Info" ForeColor="#ff0000"></asp:Label>
        <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="true" CssClass="GridView" AllowPaging="True" PageSize="20" 
            PagerSettings-Mode="Numeric" onpageindexchanging="gvList_PageIndexChanging">
            <PagerTemplate>
                <asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="First"></asp:LinkButton>
                <asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                    CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
                <asp:Label ID="lblPage" runat="server" Text='<%# "第" + (((GridView)Container.NamingContainer).PageIndex + 1)  + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
                <asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Next"></asp:LinkButton>
                <asp:LinkButton ID="lbnLast" runat="Server" Text="尾页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                    CommandName="Page" CommandArgument="Last"></asp:LinkButton>
            </PagerTemplate>
            <HeaderStyle CssClass="GridViewHeader" />
            <RowStyle CssClass="GridViewRow" />
            <FooterStyle CssClass="GirdViewFooter" />
            <AlternatingRowStyle CssClass="GirdViewAlternatingRow" />
            <PagerStyle CssClass="GridViewPager" />
            <EmptyDataRowStyle CssClass="GridViewEmptyDataRow" />
            <EmptyDataTemplate>
                没有可用的数据</EmptyDataTemplate>
        </asp:GridView>
    </fieldset>
</asp:Content>
